<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="./js/common.js"></script>
    <script src="./js/animateBak.js"></script>
    <script src="./js/axios.js"></script>
    <link rel="stylesheet" href="./index.css" />
    <div class="head">
      <div class="a">
        <li>小米商城</li>
        <li>MIUI</li>
        <li>loT</li>
        <li>云服务</li>
        <li>天星科技</li>
        <li>有品</li>
        <li>小爱平台</li>
        <li>企业团购</li>
        <li>规则协议</li>
        <li>下载app</li>
        <p><img src="./image/购物车空 (1).png" alt="" />购物车</p>
        <p>消息通知</p>
        <p>登陆</p>
        <p>注册</p>
      </div>
      <div class="b">
        <div><img src="./image/未标题-1.jpg" alt="" /></div>
        <div class="c">
          <li>xiaomi手机</li>
          <li>redmi手机</li>
          <li>电视</li>
          <li>笔记本</li>
          <li>平板</li>
          <li>家电</li>
          <li></li>
          <p>
            <button>☕搜索</button> <input type="text" placeholder="1111" />
          </p>
          <p>社区</p>
          <p>服务器</p>
          <p>路由器</p>
        </div>
      </div>
      <div class="d">
        <div class="xiaomi">
          <span>
            <li>
              <img
                src="https://img2.baidu.com/it/u=745514524,712503878&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.baidu.com/it/u=745514524,712503878&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.baidu.com/it/u=745514524,712503878&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.baidu.com/it/u=745514524,712503878&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.baidu.com/it/u=745514524,712503878&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
                alt=""
              />
            </li>
          </span>
        </div>
        <div class="xiaomi">
          <span>
            <li>
              <img
                src="https://img2.baidu.com/it/u=3317267680,1870434395&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.baidu.com/it/u=3317267680,1870434395&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.baidu.com/it/u=3317267680,1870434395&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.baidu.com/it/u=3317267680,1870434395&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.baidu.com/it/u=3317267680,1870434395&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500"
                alt=""
              />
            </li>
          </span>
        </div>
        <div class="xiaomi">
          <span>
            <li>
              <img
                src="https://img1.baidu.com/it/u=3605464334,4262178053&fm=253&fmt=auto&app=138&f=PNG?w=501&h=500"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img1.baidu.com/it/u=3605464334,4262178053&fm=253&fmt=auto&app=138&f=PNG?w=501&h=500"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img1.baidu.com/it/u=3605464334,4262178053&fm=253&fmt=auto&app=138&f=PNG?w=501&h=500"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img1.baidu.com/it/u=3605464334,4262178053&fm=253&fmt=auto&app=138&f=PNG?w=501&h=500"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img1.baidu.com/it/u=3605464334,4262178053&fm=253&fmt=auto&app=138&f=PNG?w=501&h=500"
                alt=""
              />
            </li>
          </span>
        </div>
        <div class="xiaomi">
          <span>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/2021/04/16/89180h901p0.png?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/2021/04/16/89180h901p0.png?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/2021/04/16/89180h901p0.png?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/2021/04/16/89180h901p0.png?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/2021/04/16/89180h901p0.png?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
          </span>
        </div>
        <div class="xiaomi">
          <span>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/thumbnail/2022/06/08/223815_9506982709.jpg?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/thumbnail/2022/06/08/223815_9506982709.jpg?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/thumbnail/2022/06/08/223815_9506982709.jpg?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/thumbnail/2022/06/08/223815_9506982709.jpg?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/thumbnail/2022/06/08/223815_9506982709.jpg?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
          </span>
        </div>
        <div class="xiaomi">
          <span>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/thumbnail/2022/06/04/222139_49988370828.jpg?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/thumbnail/2022/06/04/222139_49988370828.jpg?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/thumbnail/2022/06/04/222139_49988370828.jpg?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/thumbnail/2022/06/04/222139_49988370828.jpg?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
            <li>
              <img
                src="https://img2.huashi6.com/images/resource/thumbnail/2022/06/04/222139_49988370828.jpg?imageMogr2/quality/75/interlace/1/thumbnail/!224x190r/gravity/North/crop/224x190/format/webp"
                alt=""
              />
            </li>
          </span>
        </div>
      </div>

      <div class="e">
        <div class="g">
          <li>&nbsp;&nbsp;手机</li>
          <li>&nbsp;&nbsp;电脑</li>
          <li>&nbsp;&nbsp;笔记本 平板</li>
          <li>&nbsp;&nbsp;出行 穿戴</li>
          <li>&nbsp;&nbsp;耳机 音箱</li>
          <li>&nbsp;&nbsp;家电</li>
          <li>&nbsp;&nbsp;智能 路由器</li>
          <li>&nbsp;&nbsp;电源 配件</li>
          <li>&nbsp;&nbsp;健康 儿童</li>
          <li>&nbsp;&nbsp;生活 箱包</li>
          <div>
            <img
              src="https://img0.baidu.com/it/u=530426417,2082848644&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500"
              alt=""
            />
          </div>
          <div>
            <img
              src="https://img1.baidu.com/it/u=700675537,3936578503&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500"
              alt=""
            />
          </div>
          <div>
            <img
              src="https://img1.baidu.com/it/u=1966616150,2146512490&fm=253&fmt=auto&app=138&f=JPEG?w=751&h=500"
              alt=""
            />
          </div>
          <div>
            <img
              src="https://img0.baidu.com/it/u=3798217922,3880088897&fm=253&fmt=auto&app=120&f=JPEG?w=889&h=500"
              alt=""
            />
          </div>
          <div>
            <img
              src="https://img2.baidu.com/it/u=3302184040,3713353210&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500"
              alt=""
            />
          </div>
          <div>
            <img
              src="https://img0.baidu.com/it/u=857510153,4267238650&fm=253&fmt=auto&app=120&f=JPEG?w=1200&h=675"
              alt=""
            />
          </div>
          <div>
            <img
              src="https://img2.baidu.com/it/u=3302184040,3713353210&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500"
              alt=""
            />
          </div>
          <div>
            <img
              src="https://img2.baidu.com/it/u=3327615553,307421553&fm=253&fmt=auto&app=138&f=JPEG?w=843&h=500"
              alt=""
            />
          </div>
          <div>
            <img
              src="https://img2.baidu.com/it/u=1557726807,2693077908&fm=253&fmt=auto&app=138&f=JPEG?w=695&h=500"
              alt=""
            />
          </div>
          <div>
            <img
              src="https://img2.baidu.com/it/u=3948441167,4109806023&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500"
              alt=""
            />
          </div>
        </div>
        <div class="box">
          <ul class="item">
            <li>
              <img
                src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/628a0172dc664f2740250ed9691b65ee.jpg?w=2452&h=920"
              />
            </li>
            <li>
              <img
                src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/008e480893428ae9c9c4452f67a4eec9.jpg?thumb=1&w=1226&h=460&f=webp&q=90"
              />
            </li>
            <li>
              <img
                src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/9da38b92e8d2a7114321c69bf4c320f9.jpg?thumb=1&w=1226&h=460&f=webp&q=90"
              />
            </li>
            <li>
              <img
                src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/9c98d55bea67b340c37c23ea59df00b3.jpg?thumb=1&w=1226&h=460&f=webp&q=90"
              />
            </li>
            <li>
              <img
                src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/628a0172dc664f2740250ed9691b65ee.jpg?w=2452&h=920"
              />
            </li>
          </ul>
          <button class="leftBtn">&lt;</button>
          <button class="rightBtn">&gt;</button>
          <ul class="page">
            <li style="background-color: white">1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
          </ul>
        </div>
      </div>

      <div class="mage">
        <div>
          <img
            src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/2596938425e8d9019ffae94fbcfa4524.jpg?w=632&h=340"
            alt=""
          />
        </div>
        <div>
          <img
            src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/d0c0c4d84bc85c12d936bf5d8775af44.jpg?w=632&h=340"
            alt=""
          />
        </div>
        <div>
          <img
            src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/28c13d0d11b38ec17fa5d83bc6ba5912.jpg?w=632&h=340"
            alt=""
          />
        </div>
      </div>
      <div class="shuju">
        <div class="las">
          <img
            src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/b2a3468c474addf9140a21cc77a87d5c.jpeg?thumb=1&w=1533&h=150&f=webp&q=90"
            alt=""
          />
        </div>
        <div class="qwer">
          <div class="la"></div>
          <div class="lb"></div>
        </div>
      </div>
      <!-- 末尾 -->
    </div>

    <!-- js代码 -->
    <script>
      var a = document.querySelectorAll(".d div");
      var ipts = document.querySelectorAll(".c li");
      var qaq = document.querySelector(".d");
      console.log(qaq);
      console.log(ipts);
      console.log(a);
      ipts[0].onmouseover = function () {
        qaq.style.display = "block";
        a[0].style.display = "block";
        a[1].style.display = "none";
        a[2].style.display = "none";
        a[3].style.display = "none";
        a[4].style.display = "none";
        a[5].style.display = "none";
      };
      a[0].onmouseleave = function () {
        a[0].style.display = "none";
        qaq.style.display = "none";
      };
      ipts[1].onmouseover = function () {
        qaq.style.display = "block";
        a[1].style.display = "block";
        a[0].style.display = "none";
        a[2].style.display = "none";
        a[3].style.display = "none";
        a[4].style.display = "none";
        a[5].style.display = "none";
      };
      a[1].onmouseleave = function () {
        a[1].style.display = "none";
        qaq.style.display = "none";
      };
      ipts[2].onmouseover = function () {
        qaq.style.display = "block";
        a[2].style.display = "block";
        a[0].style.display = "none";
        a[1].style.display = "none";
        a[3].style.display = "none";
        a[4].style.display = "none";
        a[5].style.display = "none";
      };
      a[2].onmouseleave = function () {
        a[2].style.display = "none";
        qaq.style.display = "none";
      };
      ipts[3].onmouseover = function () {
        qaq.style.display = "block";
        a[3].style.display = "block";
        a[0].style.display = "none";
        a[1].style.display = "none";
        a[2].style.display = "none";
        a[5].style.display = "none";
        a[4].style.display = "none";
      };
      a[3].onmouseleave = function () {
        a[3].style.display = "none";
        qaq.style.display = "none";
      };
      ipts[4].onmouseover = function () {
        qaq.style.display = "block";
        a[4].style.display = "block";
        a[0].style.display = "none";
        a[1].style.display = "none";
        a[2].style.display = "none";
        a[3].style.display = "none";
        a[5].style.display = "none";
      };
      a[4].onmouseleave = function () {
        a[4].style.display = "none";
        qaq.style.display = "none";
      };
      ipts[5].onmouseover = function () {
        qaq.style.display = "block";
        a[5].style.display = "block";
        a[0].style.display = "none";
        a[1].style.display = "none";
        a[2].style.display = "none";
        a[3].style.display = "none";
        a[4].style.display = "none";
      };
      a[5].onmouseleave = function () {
        a[5].style.display = "none";
        qaq.style.display = "none";
      };
      ipts[6].onmousemove = function () {
        qaq.style.display = "none";
        a[0].style.display = "none";
        a[1].style.display = "none";
        a[2].style.display = "none";
        a[3].style.display = "none";
        a[4].style.display = "none";
        a[5].style.display = "none";
      };
      var cc = document.querySelector(".a");
      cc.onmousemove = function () {
        qaq.style.display = "none";
        a[0].style.display = "none";
        a[1].style.display = "none";
        a[2].style.display = "none";
        a[3].style.display = "none";
        a[4].style.display = "none";
        a[5].style.display = "none";
      };

      //菜单
      let memu = document.querySelectorAll(".g li");
      let qw = document.querySelectorAll(".g div");
      console.log(memu);
      console.log(qw);
      memu[0].onmousemove = function () {
        qw[0].style.display = "block";
        qw[1].style.display = "none";
        qw[2].style.display = "none";
        qw[3].style.display = "none";
        qw[4].style.display = "none";
        qw[5].style.display = "none";
        qw[6].style.display = "none";
        qw[7].style.display = "none";
        qw[8].style.display = "none";
        qw[9].style.display = "none";
      };
      qw[0].onmouseleave = function () {
        qw[0].style.display = "none";
      };
      memu[1].onmousemove = function () {
        qw[1].style.display = "block";
        qw[0].style.display = "none";
        qw[2].style.display = "none";
        qw[3].style.display = "none";
        qw[4].style.display = "none";
        qw[5].style.display = "none";
        qw[6].style.display = "none";
        qw[7].style.display = "none";
        qw[8].style.display = "none";
        qw[9].style.display = "none";
      };
      qw[1].onmouseleave = function () {
        qw[1].style.display = "none";
      };
      memu[2].onmousemove = function () {
        qw[2].style.display = "block";
        qw[1].style.display = "none";
        qw[0].style.display = "none";
        qw[3].style.display = "none";
        qw[4].style.display = "none";
        qw[5].style.display = "none";
        qw[6].style.display = "none";
        qw[7].style.display = "none";
        qw[8].style.display = "none";
        qw[9].style.display = "none";
      };
      qw[2].onmouseleave = function () {
        qw[2].style.display = "none";
      };
      memu[3].onmousemove = function () {
        qw[3].style.display = "block";
        qw[1].style.display = "none";
        qw[2].style.display = "none";
        qw[0].style.display = "none";
        qw[4].style.display = "none";
        qw[5].style.display = "none";
        qw[6].style.display = "none";
        qw[7].style.display = "none";
        qw[8].style.display = "none";
        qw[9].style.display = "none";
      };
      qw[3].onmouseleave = function () {
        qw[3].style.display = "none";
      };
      memu[4].onmousemove = function () {
        qw[4].style.display = "block";
        qw[1].style.display = "none";
        qw[2].style.display = "none";
        qw[3].style.display = "none";
        qw[0].style.display = "none";
        qw[5].style.display = "none";
        qw[6].style.display = "none";
        qw[7].style.display = "none";
        qw[8].style.display = "none";
        qw[9].style.display = "none";
      };
      qw[4].onmouseleave = function () {
        qw[4].style.display = "none";
      };
      memu[5].onmousemove = function () {
        qw[5].style.display = "block";
        qw[1].style.display = "none";
        qw[2].style.display = "none";
        qw[3].style.display = "none";
        qw[4].style.display = "none";
        qw[0].style.display = "none";
        qw[6].style.display = "none";
        qw[7].style.display = "none";
        qw[8].style.display = "none";
        qw[9].style.display = "none";
      };
      qw[5].onmouseleave = function () {
        qw[5].style.display = "none";
      };
      memu[6].onmousemove = function () {
        qw[6].style.display = "block";
        qw[1].style.display = "none";
        qw[2].style.display = "none";
        qw[3].style.display = "none";
        qw[4].style.display = "none";
        qw[5].style.display = "none";
        qw[0].style.display = "none";
        qw[7].style.display = "none";
        qw[8].style.display = "none";
        qw[9].style.display = "none";
      };
      qw[6].onmouseleave = function () {
        qw[6].style.display = "none";
      };
      memu[7].onmousemove = function () {
        qw[7].style.display = "block";
        qw[1].style.display = "none";
        qw[2].style.display = "none";
        qw[3].style.display = "none";
        qw[4].style.display = "none";
        qw[5].style.display = "none";
        qw[6].style.display = "none";
        qw[0].style.display = "none";
        qw[8].style.display = "none";
        qw[9].style.display = "none";
      };
      qw[7].onmouseleave = function () {
        qw[7].style.display = "none";
      };
      memu[8].onmousemove = function () {
        qw[8].style.display = "block";
        qw[1].style.display = "none";
        qw[2].style.display = "none";
        qw[3].style.display = "none";
        qw[4].style.display = "none";
        qw[5].style.display = "none";
        qw[6].style.display = "none";
        qw[7].style.display = "none";
        qw[0].style.display = "none";
        qw[9].style.display = "none";
      };
      qw[8].onmouseleave = function () {
        qw[8].style.display = "none";
      };
      memu[9].onmousemove = function () {
        qw[9].style.display = "block";
        qw[1].style.display = "none";
        qw[2].style.display = "none";
        qw[3].style.display = "none";
        qw[4].style.display = "none";
        qw[5].style.display = "none";
        qw[6].style.display = "none";
        qw[7].style.display = "none";
        qw[8].style.display = "none";
        qw[0].style.display = "none";
      };
      qw[9].onmouseleave = function () {
        qw[9].style.display = "none";
      };
      let gg = document.querySelector(".g");
      gg.onmouseleave = function () {
        qw[9].style.display = "none";
        qw[1].style.display = "none";
        qw[2].style.display = "none";
        qw[3].style.display = "none";
        qw[4].style.display = "none";
        qw[5].style.display = "none";
        qw[6].style.display = "none";
        qw[7].style.display = "none";
        qw[8].style.display = "none";
        qw[0].style.display = "none";
      };

      //  轮播图
      let pagenum = 0;
      let pageLis = document.querySelectorAll(".page li");
      let itemUl = document.querySelector(".item");
      pageLis.forEach((li, i) => {
        li.onclick = () => {
          console.log(li);
          console.log(i);
          pageLis[pagenum].style.background = "red";
          li.style.background = "white";
          animate(itemUl, { left: -i * 1041 });
          pagenum = i;
        };
      });
      let rightBtn = document.querySelector(".rightBtn");
      let leftBtn = document.querySelector(".leftBtn");
      rightBtn.onclick = function () {
        if (pagenum == 4) {
          pageLis[0].style.background = "red";
        } else {
          pageLis[pagenum].style.background = "red";
        }
        let nextPage = pagenum + 1;
        if (nextPage == 5) {
          itemUl.style.left = 0;
          nextPage = 1;
        }
        animate(itemUl, { left: -nextPage * 1041 });
        if (nextPage == 4) {
          pageLis[0].style.background = "white"; // Cannot read properties of undefined(reading 'style')  不能读取undefined的属性
        } else {
          pageLis[nextPage].style.background = "white"; // Cannot read properties of undefined(reading 'style')  不能读取undefined的属性
        }
        pagenum = nextPage;
      };
      leftBtn.onclick = function () {
        pageLis[pagenum].style.background = "red";
        let nextPage = pagenum - 1;
        console.log(pageLis);
        console.log(nextPage);
        console.log(pageLis[nextPage]);
        if (nextPage == -1) {
          itemUl.style.left = -4 * 1041 + "px";
          nextPage = 3;
        }
        pageLis[nextPage].style.background = "white";
        animate(itemUl, { left: -nextPage * 1041 });
        pagenum = nextPage;
      };
      let timer = setInterval(() => {
        rightBtn.onclick();
      }, 3000);
      let box = document.querySelector(".box");
      box.onmouseenter = function () {
        clearInterval(timer);
      };
      box.onmouseleave = function () {
        timer = setInterval(() => {
          rightBtn.onclick();
        }, 3000);
      };

      //shangpin
      let uid = localStorage.getItem("id");
      let token = localStorage.getItem("token");
      console.log(token);
      console.log(uid);

      //   4-2
      //  商品列表
      async function loadList() {
        let url = "http://jx.xuzhixiang.top/ap/api/allproductlist.php?";
        let data = { pagesize: 1, pagenum: 0, uid };
        let r = await axios.get(url, { params: data });
        console.log(r.data);
        let resArr = r.data.data.map(
          (v) => `
                  <li>
                      <h2>${v.pname}</h2>
                     <img src="${v.pimg}" alt="" onclick=qqq(${v.pid})>
                      <p>${v.pprice}$</p>
                  </li>
              `
        );
        document.querySelector(".la").innerHTML = resArr.join("");
      }
      loadList();

      function qqq(pid) {
        console.log(pid);
        localStorage.setItem("xid", pid);
        location.href = "xiangqing.html";
      }

      async function loadList1() {
        let url = "http://jx.xuzhixiang.top/ap/api/allproductlist.php?";
        let data = { pagesize: 8, pagenum: 0, uid };
        let r = await axios.get(url, { params: data });
        console.log(r.data);
        let resArr = r.data.data.map(
          (v) => `
                  <li>
                     <img src="${v.pimg}" alt="" onclick=qqq(${v.pid})>
                     <h2>${v.pname}</h2>
                      <p>${v.pprice}$</p>
                  </li>
              `
        );
        document.querySelector(".lb").innerHTML = resArr.join("");
      }
      loadList1();

      function qqq(pid) {
        console.log(pid);
        localStorage.setItem("xid", pid);
        location.href = "xiangqing.html";
      }
    </script>
  </body>
</html>
